﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Admin_admin_khachhang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "NutXoaKH")
        {
            int chiso = int.Parse(e.CommandArgument.ToString());
            int ma = int.Parse(gv1.Rows[chiso].Cells[0].Text);
            try
            {
                string chuoixoa = "DELETE FROM KhachHang WHERE makh=" + ma;
                XLDL.thuchienlenh(chuoixoa);
                Response.Redirect("~/Admin/admin-khachhang.aspx");
            }
            catch
            {
                lbThongBao.Text = " Xóa dữ liệu thất bại";
            }
        }
    }
}